from flask import Blueprint
# from .models import *
blue = Blueprint('user',__name__)
@blue.route('/')
def index1():
    return 'Flask'

# String 接收任何没有斜杠（'/'）的字符串（默认）
# @blue.route('/string/<string:name>')
# @blue.route('/string/<name>')
# def get_string(name):
#     print(name,type(name))
#     return name

# int
# @blue.route('/int/<int:id>')
# def get_int(id):
#     print(id,type(id))
#     return str(id)

# float
# @blue.route('/float/<float:money>')
# def get_float(money):
#     print(money,type(money))
#     return str(money)

# path 支持带 / 的字符串
# @blue.route('/path/<path:name>')
# def get_float(name):
#     print(name,type(name))
#     return str(name)

# uuid  只接受uuid字符串，唯一码，一种生成规则   016e87a1-9729-4f32-ac13-8455e9be39a2
# @blue.route('/uuid/<uuid:id>')
# def get_float(id):
#     print(id,type(id))
#     return str(id)

#  获取uuid
# @blue.route('/getuuid')
# def get_uuid2():
#     import uuid


# any
@blue.route('/any/<any(java,C,python):language>')
def get_any(language):
    print(language,type(language))
    return str(language)


# methods: 请求方式
#   默认不支持POST
#   如果需要同时支持GET和POST，就设置methods
@blue.route('/methods',methods=['GET','POST'])
def get_methods():
    return 'methods'